# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Francois Boulogne <fboulogne at april dot org>

pkgname=python-gphoto2
pkgver=2.3.4
pkgrel=2
pkgdesc="Python interface to libgphoto2"
arch=('loong64' 'x86_64')
url="https://github.com/jim-easterbrook/python-gphoto2"
license=('GPL3')
depends=('libgphoto2' 'python')
makedepends=('swig' 'python-setuptools')
source=($pkgname-$pkgver.tar.gz::https://github.com/jim-easterbrook/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('80dd2bc08de4e883e2513835ebba8b8587ad21e70cb828f1374d161c171665c3')

prepare() {
  cd $pkgname-$pkgver
#https://github.com/jim-easterbrook/python-gphoto2/issues/136
  python developer/build_swig.py system
}

build() {
  cd $pkgname-$pkgver
  python setup.py build
}

package(){
  cd $pkgname-$pkgver
  python setup.py install --root="${pkgdir}" --optimize=1
}
